const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    //movable-view的宽度
    width: {
      type: Number,
      value: 88,
    },
    //movable-view的高度
    height: {
      type: Number,
      value: 88,
    },

    //movable-view内部图片的宽度
    imgWidth: {
      type: Number,
      value: 26,
    },
    //movable-view内部图片的高度
    imgHeight: {
      type: Number,
      value: 26,
    },
    name: {
      type: String,
      value: "新增"
    },
    axisX: {
      type: Number,
      value: app.globalData.systemInfo.windowWidth - 50 || 0,
    },
    axisY: {
      type: Number,
      value: app.globalData.systemInfo.windowHeight - 150 || 0,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    x: "",
    y: ""
  },

  lifetimes: {
    attached() {
      this.setData({
        x: this.data.axisX,
        y: this.data.axisY
      })
    },
  },
  /**
   * 组件的方法列表
   */
  methods: {
    movableTap(e) {
      this.triggerEvent("click", {
        e
      })
    },

    movableChange(e) {
      let {
        x,
        y
      } = e.detail;
      this.setData({
        x,
        y
      })
    }
  }
})